-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve long compile times when evaluating always valid constants #67667
Resolve long compile times when evaluating always valid constants #67667
Conversation
8a45951
to
dce8826
Compare
Force pushed |
dce8826
to
19834f3
Compare
19834f3
to
31e1c41
Compare
Force pushed. We're back to the original version with an added |
const FOO: [Empty; 3] = [foo(); 3]; | ||
|
||
#[warn(const_err)] | ||
const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
side note: if you remove this constant and its use, you do get a hard error on the use of FOO
, but BAR
is what we are actually interested in testing here, because it causes validation to error instead of const eval.
@bors r+ |
📌 Commit 31e1c41 has been approved by |
…d_constants, r=oli-obk Resolve long compile times when evaluating always valid constants This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes rust-lang#67539 r? @oli-obk cc @RalfJung @spastorino
Seems failed in #67704 (comment) |
This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes rust-lang#67539
31e1c41
to
5ca3a1b
Compare
Ignored 32-bit platforms in the @bors r=oli-obk |
📌 Commit 5ca3a1b has been approved by |
…, r=oli-obk Resolve long compile times when evaluating always valid constants This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539 r? @oli-obk cc @RalfJung @spastorino
☀️ Test successful - checks-azure |
Stable nominating per #68873. |
discussed at T-compiler meeting. stable-accepted. |
[stable] 1.41.1 release This backports the following PRs: * Revert "Remove `checked_add` in `Layout::repeat`" #69241 * Do not ICE when encountering `yield` inside `async` block #69175 * Correct ICE caused by macros generating invalid spans. #68611 * Changelog: Demonstrate final build-override syntax #68603 * Resolve long compile times when evaluating always valid constants #67667 * Fix MIR typeck soundness holes #69145 This also includes a commit which rustfmt's files which the latter commits touched (and perhaps a bit more) to make rebasing the PRs go more smoothly (thankfully, this should be the last time we need to do so). I have removed stable-nominated tags from PRs successfully backported.
[stable] 1.41.1 release This backports the following PRs: * Revert "Remove `checked_add` in `Layout::repeat`" #69241 * Do not ICE when encountering `yield` inside `async` block #69175 * Correct ICE caused by macros generating invalid spans. #68611 * Changelog: Demonstrate final build-override syntax #68603 * Resolve long compile times when evaluating always valid constants #67667 * Fix MIR typeck soundness holes #69145 This also includes a commit which rustfmt's files which the latter commits touched (and perhaps a bit more) to make rebasing the PRs go more smoothly (thankfully, this should be the last time we need to do so). I have removed stable-nominated tags from PRs successfully backported.
This extends the existing logic which skips validating every integer or
floating point number type to also skip validating empty structs because
they are also trivially valid.
Fixes #67539
r? @oli-obk
cc @RalfJung @spastorino